#ifndef __SENSOR_H__
#define __SENSOR_H__
#include "bsp_system.h"

extern uint8_t sensor_arry[9];
extern uint8_t tracking_move;
extern uint8_t stop_flag;
extern float offset;
extern uint8_t path_state; 

// 正方形循迹相关变量
extern uint8_t square_state;
extern uint32_t square_timer;
extern uint8_t square_step;

extern void buzzer_beep(uint8_t times, uint32_t on_ms, uint32_t off_ms);

void sensor_read(uint8_t *sensor_arry);
void Sensor_TaskWrapper(void);
void sensor_track_PID_Init(void);
float cal_sensor_offset(void);
void motor_speed_set(int16_t left_speed, int16_t right_speed);

void square_tracking_task(void);
void square_straight(void);


#endif

